using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class ATL_BillsMap : EntityTypeConfiguration<ATL_Bills>
    {
        public ATL_BillsMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Number)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Bill_)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Patient_id)
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.Batch)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.DeleteUser)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("ATL_Bills");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.Bill_).HasColumnName("Bill#");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Patient_id).HasColumnName("Patient_id");
            this.Property(t => t.Total).HasColumnName("Total");
            this.Property(t => t.Batch).HasColumnName("Batch");
            this.Property(t => t.Admission).HasColumnName("Admission");
            this.Property(t => t.DeleteDate).HasColumnName("DeleteDate");
            this.Property(t => t.DeleteUser).HasColumnName("DeleteUser");
            this.Property(t => t.CreateUser).HasColumnName("CreateUser");
            this.Property(t => t.InOut).HasColumnName("InOut");
            this.Property(t => t.ActionType).HasColumnName("ActionType");
        }
    }
}
